package com.fwmagic.dp._6._6_3;

public class SubjectDynamicProxy extends DynamicProxy {

    public static <T> T newProxyInstance(Subject subject){
        //获得classLoader
        ClassLoader classLoader = subject.getClass().getClassLoader();
        //获得interfaces
        Class<?>[] interfaces = subject.getClass().getInterfaces();
        //获得handler
        MyInvocationHandler handler = new MyInvocationHandler(subject);

        return newProxyInstance(classLoader,interfaces,handler);
    }
}
